package com.company.domain.repository;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.NoRepositoryBean;

@NoRepositoryBean
public interface BaseRepository<T, ID extends Serializable> extends
		JpaRepository<T, ID> {
	T findSingleObject(String queryString, Object... params);

	List<Map<String, Object>> executeNativeQuery(String queryString,
			Integer startPosition, Integer maxResult, String[] resultFields,
			Object... params);

	int executeNativeQuery(String queryString, Object... params);

	List<T> executeQuery(String queryString, Integer startPosition,
			Integer maxResult, Object... params);

	List<T> executeListQuery(String queryString, Integer startPosition,
			Integer maxResult, Map<String, Object> params);

	Map<String, Object> createParameterizedQueryString(String entityName,
			String propertyName, Map<String, Object> attr);

	Map<String, Object> createQueryString(String entityName,
			String propertyName, Map<String, Object> attr);

	Long executeCountQuery(String queryString, Integer startPosition,
			Integer maxResult, Map<String, Object> params);

	Long executeCountQuery(String queryString, Object[] params);
	
	Map<String, Object> createQueryString(String entityName,
			String propertyName, Map<String, Object> attr,Map<String, String> operators);
}